package com.salary.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.staff.entity.Staff;
import com.welfare.entity.WelfareRecord;

@Entity
@Table(name="t_salary_record")
public class SalaryRecord {//薪资记录实体类，实现关联关系
	private Long id;
	private float absence;
	private float _leave;
	private float overtime;
	private float performance;
	private float welfare;
	private Date accountTime;
	private float total;
	private float tax;
	private List<WelfareRecord> welfareRecords = new ArrayList();
	private Tax taxRecord;
	private SalaryFormula salaryFormula;
	private Staff staff;
	private BasicSalary basicSalary;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	
	@ManyToMany(cascade=CascadeType.ALL)
	public List<WelfareRecord> getWelfareRecords() {
		return welfareRecords;
	}

	@OneToOne(cascade=CascadeType.ALL)
	public Tax getTaxRecord() {
		return taxRecord;
	}
	@ManyToOne(cascade=CascadeType.ALL)
	public SalaryFormula getSalaryFormula() {
		return salaryFormula;
	}
	@ManyToOne(cascade=CascadeType.ALL)
	public Staff getStaff() {
		return staff;
	}
	@ManyToOne(cascade=CascadeType.ALL)
	public BasicSalary getBasicSalary() {
		return basicSalary;
	}

	public float getAbsence() {
		return absence;
	}

	public float get_leave() {
		return _leave;
	}

	public float getOvertime() {
		return overtime;
	}

	public float getPerformance() {
		return performance;
	}

	public float getWelfare() {
		return welfare;
	}

	public Date getAccountTime() {
		return accountTime;
	}

	public float getTotal() {
		return total;
	}

	public float getTax() {
		return tax;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setAbsence(float absence) {
		this.absence = absence;
	}

	public void set_leave(float _leave) {
		this._leave = _leave;
	}

	public void setOvertime(float overtime) {
		this.overtime = overtime;
	}

	public void setPerformance(float performance) {
		this.performance = performance;
	}

	public void setWelfare(float welfare) {
		this.welfare = welfare;
	}

	public void setAccountTime(Date accountTime) {
		this.accountTime = accountTime;
	}

	public void setTotal(float total) {
		this.total = total;
	}

	public void setTax(float tax) {
		this.tax = tax;
	}

	

	public void setWelfareRecords(List<WelfareRecord> welfareRecords) {
		this.welfareRecords = welfareRecords;
	}


	public void setTaxRecord(Tax taxRecord) {
		this.taxRecord = taxRecord;
	}

	public void setSalaryFormula(SalaryFormula salaryFormula) {
		this.salaryFormula = salaryFormula;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public void setBasicSalary(BasicSalary basicSalary) {
		this.basicSalary = basicSalary;
	}

	
	
}
